Union Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Computes the union of this set with another set. The union of two sets is all items that appear in either or both of the sets. A new set is created with the union of the sets and is returned. This set and the other set are unchanged.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public Set<T> Union(
	Set<T> otherSet
)
Visual Basic (Declaration)
Public Function Union ( _
	otherSet As Set(Of T) _
) As Set(Of T)
Visual C++
public:
Set<T>^ Union (
	Set<T>^ otherSet
)

Parameters

otherSet
Set<(Of <T>)>
Set to union with.

Return Value

The union of the two sets.

Remarks

If equal items appear in both sets, the union will include an arbitrary choice of one of the two equal items.

The union of two sets is computed in time O(M + N), where M is the size of the one set, and N is the size of the other set.

Exceptions

ExceptionCondition
System..::InvalidOperationExceptionThis set and otherSet don't use the same method for comparing items.

See Also